<template>
	<view>
		<header-top :messageInfo="{typeFlag:false,message:'全部功能'}"></header-top>
		<view class="mainpadding">
			<u-swiper :list="images_text" keyName="image_text" @click="lbtbtn" @change="e => currentNum = e.current"
				:autoplay="false" indicatorStyle="right: 20px">
				<view slot="indicator" class="indicator-num">
					<text class="indicator-num__text"> {{ currentNum + 1 }}/{{images_text.length}}</text>
				</view>
			</u-swiper>
		</view>
		<view class="colorbox colorone">客户</view>
		<view class="alllable flexbetween">
			<view class="itemlable flexleft" @click="jumpurl('/pages/customermanagement/customermanagement')">
				<view class="lableimage flexcenter">
					<image src="../../static/imags/all/icon1.png" class="image_1" mode=""></image>
				</view>
				<text>客户管理</text>
			</view>
			<view class="itemlable flexleft" @click="jumpurl('/pages/customerregist/customerregist')">
				<view class="lableimage flexcenter">
					<image src="../../static/imags/all/icon2.png" class="image_1" mode=""></image>
				</view>
				<text>客户注册</text>
			</view>
			<view class="itemlable flexleft" @click="jumpurl('/pages/maincustomerrank/maincustomerrank')">
				<view class="lableimage flexcenter">
					<image src="../../static/imags/all/icon3.png" class="image_3" mode=""></image>
				</view>
				<text>客户排名</text>
			</view>
			<view class="itemlable flexleft" @click="jumpurl('/pages/customerrenewal/customerrenewal')">
				<view class="lableimage flexcenter">
					<image src="../../static/imags/all/icon4.png" class="image_4" mode=""></image>
				</view>
				<text>续费提醒</text>
			</view>
		</view>
		<view class="colorbox colortwo">销售</view>
		<view class="alllable flexbetween">
			<view class="itemlable flexleft" @click="jumpurl('/pages/myemploy/myemploy')">
				<view class="lableimage flexcenter">
					<image src="../../static/imags/all/icon5.png" class="image_5" mode=""></image>
				</view>
				<text>我的合作方</text>
			</view>
			<view class="itemlable flexleft" @click="jumpurl('/pages/incomerank/incomerank')">
				<view class="lableimage flexcenter">
					<image src="../../static/imags/all/icon6.png" class="image_6" mode=""></image>
				</view>
				<text>销售排名</text>
			</view>
			<view class="itemlable flexleft" @click="jumpurl('/pages/salesorder/salesorder')">
				<view class="lableimage flexcenter">
					<image src="../../static/imags/all/icon7.png" class="image_7" mode=""></image>
				</view>
				<text>销售订单</text>
			</view>
			<view class="itemlable flexleft" @click="jumpurl('/pages/datastatistical/datastatistical')">
				<view class="lableimage flexcenter">
					<image src="../../static/imags/all/icon8.png" class="image_8" mode=""></image>
				</view>
				<text>数据统计</text>
			</view>
		</view>
		<view class="colorbox colorthree">其他</view>
		<view class="alllable flexbetween">
			<view class="itemlable flexleft" @click="switchurl('/pages/newspage/newspage')">
				<view class="lableimage flexcenter">
					<image src="../../static/imags/all/icon9.png" class="image_9" mode=""></image>
				</view>
				<text>消息</text>
			</view>
			<view class="itemlable flexleft" @click="jumpurl('/pages/mypage/opinion')">
				<view class="lableimage flexcenter">
					<image src="../../static/imags/all/icon10.png" class="image_10" mode=""></image>
				</view>
				<text>意见反馈</text>
			</view>
			<view class="itemlable flexleft" @click="jumpurl('/pages/mypage/lookMoney')">
				<view class="lableimage flexcenter">
					<image src="../../static/imags/all/icon11.png" class="image_11" mode=""></image>
				</view>
				<text>我的钱包</text>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				currentNum: 0,

				images_text: [{
					image: "/uploads/20220624/854174d34c5e26f78cdffc9203c7b7cc.jpg", //图片
					url: "", //跳转链接
				}],
			}
		},
		onLoad() {
			this.getgg()
		},
		onShow() {
			this.getInfo()
		},
		methods: {
			getInfo(){ //消息未读数量
				console.log()
				let _this = this;
				httpRequest.request('/employeesapi/index/newsNoReadNum', 'GET', {
					
				}, false, false, true).then(res => {
					if (res.code == 1) {
						this.info=res.data
						if(res.data.total_noread_num!=0){
							uni.setTabBarBadge({
								index: 1,
								text: res.data.total_noread_num
							})
						}else{
							uni.removeTabBarBadge({
								index:1
							})
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			// 广告
			getgg() {
				httpRequest.request('/employeesapi/index/getAdvertiseList', 'POST', {
					advertise_position_id:3
				}).then(res => {
					this.images_text = res.data
					// console.log(res, 222)
				})
			},
			// 点击轮播图
			lbtbtn(i) {
				console.log(i)
				this.images_text.forEach((item,index)=>{
					if(index==i){
						uni.navigateTo({
							url:item.url
						})
					}
				})
			},
			jumpurl(url) {
				uni.navigateTo({
					url: url
				})
			},
			switchurl(url) {
				uni.switchTab({
					url: url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.colorbox {
		padding: 20rpx 50rpx;
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 800;
		color: #333333;
	}

	.colorone {
		background-color: #FAD3D3;
	}

	.colortwo {
		background-color: #FFEFD0;
	}

	.colorthree {
		background-color: #CEE0FF;
	}

	// 模块开始
	.alllable {
		padding: 0 50rpx 40rpx 50rpx;
		flex-wrap: wrap;
	}

	.itemlable {
		width: 50%;
		margin-top: 30rpx;
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: 800;
		color: #333333;
	}

	.lableimage {
		width: 96rpx;
		height: 71rpx;
		margin-right: 15rpx;
	}

	.image_1 {
		width: 68rpx;
		height: 71rpx;
	}

	.image_3 {
		width: 54rpx;
		height: 56rpx;
	}

	.image_4 {
		width: 57rpx;
		height: 58rpx;
	}

	.image_5 {
		width: 96rpx;
		height: 56rpx;
	}

	.image_6 {
		width: 68rpx;
		height: 63rpx;
	}

	.image_7 {
		width: 59rpx;
		height: 68rpx;
	}

	.image_8 {
		width: 64rpx;
		height: 68rpx;
	}

	.image_9 {
		width: 70rpx;
		height: 68rpx;
	}

	.image_10 {
		width: 63rpx;
		height: 69rpx;
	}

	.image_11 {
		width: 71rpx;
		height: 69rpx;
	}
</style>
